﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace covariant
{
    public class Program
    {
        static void Main(string[] args)
        {
            Shape shape = new Circle();

            List<Circle> circles = new List<Circle>();
            //List<Shape> shapes = circles;  编译不能通过
            IEnumerable<Circle> circles2 = new List<Circle>();
            IEnumerable<Shape> shapes = circles2;

            Circle c = new Circle();
            c.Size = 1;
            c.Height = 2;
            Console.WriteLine(shape is Shape);

            Shape s = c as Shape;
            Console.WriteLine(s.Height);

            Console.WriteLine(sizeof(double));

            unsafe
            {
                Console.WriteLine(sizeof(Circle));
            }

            Console.WriteLine(typeof(Shape));

            Console.WriteLine(nameof(c.Height));

            Console.WriteLine(nameof(Method));

            Console.ReadKey();
        }

        public void Method(int a)
        {

        }
    }
}
